#!/bin/sh

# 将环境变量写入到JS配置文件中
cat > /usr/share/nginx/html/config.js <<EOF
window.env = {
  BACKEND_URL: '${BACKEND_URL:-http://localhost:8911}'
};
EOF

# 启动nginx
nginx -g 'daemon off;'